/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "PELATIS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pelatis.findAll", query = "SELECT p FROM Pelatis p"),
    @NamedQuery(name = "Pelatis.findByCode", query = "SELECT p FROM Pelatis p WHERE p.code = :code"),
    @NamedQuery(name = "Pelatis.findByOnoma", query = "SELECT p FROM Pelatis p WHERE p.onoma = :onoma"),
    @NamedQuery(name = "Pelatis.findByEponimo", query = "SELECT p FROM Pelatis p WHERE p.eponimo = :eponimo"),
    @NamedQuery(name = "Pelatis.findByTel1", query = "SELECT p FROM Pelatis p WHERE p.tel1 = :tel1"),
    @NamedQuery(name = "Pelatis.findByTel2", query = "SELECT p FROM Pelatis p WHERE p.tel2 = :tel2"),
    @NamedQuery(name = "Pelatis.findByTel3", query = "SELECT p FROM Pelatis p WHERE p.tel3 = :tel3"),
    @NamedQuery(name = "Pelatis.findByTel4", query = "SELECT p FROM Pelatis p WHERE p.tel4 = :tel4"),
    @NamedQuery(name = "Pelatis.findByAdress", query = "SELECT p FROM Pelatis p WHERE p.adress = :adress")})
public class Pelatis implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "CODE")
    private Integer code;
    @Column(name = "ONOMA")
    private String onoma;
    @Column(name = "EPONIMO")
    private String eponimo;
    @Column(name = "TEL1")
    private String tel1;
    @Column(name = "TEL2")
    private String tel2;
    @Column(name = "TEL3")
    private String tel3;
    @Column(name = "TEL4")
    private String tel4;
    @Column(name = "ADRESS")
    private String adress;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pelatisid")
    private List<Paraggelia> paraggeliaList;

    public Pelatis() {
    }

    public Pelatis(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getOnoma() {
        return onoma;
    }

    public void setOnoma(String onoma) {
        this.onoma = onoma;
    }

    public String getEponimo() {
        return eponimo;
    }

    public void setEponimo(String eponimo) {
        this.eponimo = eponimo;
    }

    public String getTel1() {
        return tel1;
    }

    public void setTel1(String tel1) {
        this.tel1 = tel1;
    }

    public String getTel2() {
        return tel2;
    }

    public void setTel2(String tel2) {
        this.tel2 = tel2;
    }

    public String getTel3() {
        return tel3;
    }

    public void setTel3(String tel3) {
        this.tel3 = tel3;
    }

    public String getTel4() {
        return tel4;
    }

    public void setTel4(String tel4) {
        this.tel4 = tel4;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    @XmlTransient
    public List<Paraggelia> getParaggeliaList() {
        return paraggeliaList;
    }

    public void setParaggeliaList(List<Paraggelia> paraggeliaList) {
        this.paraggeliaList = paraggeliaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (code != null ? code.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pelatis)) {
            return false;
        }
        Pelatis other = (Pelatis) object;
        if ((this.code == null && other.code != null) || (this.code != null && !this.code.equals(other.code))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.Pelatis[ code=" + code + " ]";
    }
    
}
